fix(cli): open localhost instead of the wildcard bind address when auto-opening the web UI - #3560
Merged
sailist merged 1 commit intoSep 6, 2026
Conversation
…to-opening the web UI `kimi web --host 0.0.0.0` (or `--host ::`) auto-opened the browser on the wildcard bind address, which is not navigable. Open localhost on the same port instead, matching the ready banner's Local: line. Also make the ready banner's port parsing tolerate the `::` wildcard origin, which crashed `new URL()` at startup. Co-authored-by: qer <wbxl2000@outlook.com>
🦋 Changeset detectedLatest commit: 46c465c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
commit: |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3559
What
kimi web --host 0.0.0.0auto-opened the browser onhttp://0.0.0.0:<port>/#token=..., which is not navigable — the browser shows an unreachable page even though the server is fine and the ready banner prints the correctLocal: http://localhost:<port>line.browserOpenOrigin()inaccess-urls.ts: rewrites a wildcard bind host (0.0.0.0/::/ empty) in the bound origin tolocalhost, keeping the actual bound port; navigable origins pass through unchanged. This reuses the same wildcard rule the banner'sLocal:line already applies.handleWebCommand's auto-open path now goes through it, so the opened URL matches the banner.formatReadyBannercomputed the port withnew URL(origin), which throwsInvalid URLon thehttp://:::<port>origin of a--host ::bind and killed the startup banner. It now takes the port from the origin's last segment.Tests
web.test.ts: auto-open on a0.0.0.0bind openshttp://localhost:<port>/#token=...; a::bind openshttp://localhost:<port>(also covers the banner crash fix, since the banner renders on that path).browserOpenOriginunit tests: wildcard rewrites (IPv4 + IPv6) and pass-through for loopback / LAN / bracketed IPv6 origins.apps/kimi-code/test/cli/webtests,tsc --noEmit,check-no-comments, andoxlint --type-awareall green.